/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PropertyRental.war.servlets;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author Sébastien
 */
public class DeletePropertyAction extends Action {
    public DeletePropertyAction(String success, String fail) {
        super(success,fail);
    }
    
    @Override
    public String perform(HttpServletRequest req) {
        try {
            if (req.getParameter("del") != null) {
                Long id = Long.parseLong(req.getParameter("id"));

                if (propertyEJB.deleteProperty(id)) {
                    return this.getSuccesspage();
                }
            }
        } catch (Exception ex) {
        }
        return this.getFailpage();
    }

}
